import {
TOKEN,
LOGINBOX,
CLOSELOGINBOX,
LOGIN,
LOGINTO,
CLOSELOGIN,
HEADERH,
CARTOPEN,
CARTCLOSE,
HEADEROUT,
ISLOADING,
WAPNAV,
WAPCART
} from './mutation-types.js'

export default {
	//获取token
	[TOKEN](state,value) {
		state.token=value
	},
	//弹出登录窗
	[LOGINBOX](state) {
		state.loginbg=true
	},
	//关闭登录窗
	[CLOSELOGINBOX](state) {
		state.loginbg=false
	},
	//登录
	[LOGIN](state,value) {
		state.token=value
		state.login=true
		state.loginbg=false
	},
	//重新登录
	[LOGINTO](state) {
		state.loginbg=true
	},
	//退出登录
	[CLOSELOGIN](state) {
		state.loginbg=false
		state.login=false
	},
	//搜索框
	[HEADERH](state,value) {
		state.headerH=value
		if(value<560){
			state.headerShow=false
			state.loadFirst=false
		}else{
			state.headerShow=true
		}
	},
	//打开购物车
	[CARTOPEN](state) {
		state.cartStart=true
	},

	[CARTCLOSE](state) {
		state.cartStart=false
	},
	//关闭首页大图
	[HEADEROUT](state) {
		state.loadFirst=false
	},
	//加载中
	[ISLOADING](state,value) {
		state.isLoading = value
	},
	//网站导航栏目
	[WAPNAV](state,value) {
		state.wapNavData = value
	},
	//购物车信息
	[WAPCART](state,value) {
		state.wapCartNum = value.num
  		state.wapCartPrice = value.price
	}
}
